<!--
 * @FileDescription 俯仰角
 * @Author 杨宇翔
 * @Date 20220713 11:42:01
 * @LastEditors 杨宇翔
 * @LastEditTime 20220713 11:42:01
-->
<template>
    <div class="pitch-angle">
        <div class="img-container">
            <!-- <img src="/static/InertialNavigation/pic_2_bg.png"> -->
            <div class="arrow">
                <!-- <img src="/static/InertialNavigation/ic_2_arrow.png"> -->
            </div>
        </div>
        <div class="information">
            <span>俯仰角</span>
            <span>{{ yaw }}</span>
        </div>
    </div>
</template>

<script setup lang="ts">
import { ProtocolComponent } from './InertialNavigationComponent';
import { computed } from 'vue';

const yaw = computed(() => ProtocolComponent.Default.Frame.Yaw)
const transformValue = computed(() => `translate(-50%, -50%) rotateZ(${ProtocolComponent.Default.Frame.Yaw}deg)`)
</script>

<style scoped>
.pitch-angle {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 7rem;
}

.chart {
    width: 20rem;
    height: 20rem;
}

.information {
    display: flex;
    justify-content: center;
    align-items: center;
}

span {
    display: inline-block;
    width: 12rem;

    color: #81859C;
    font-size: 1.8rem;

    text-overflow: ellipsis;
    overflow: hidden;
    white-space: nowrap;
}

span:last-of-type {
    display: inline-block;

    width: 15rem;
    height: 3.6rem;
    color: #B1B1D4;
    font-size: 1.8rem;
    line-height: 3.6rem;
    text-align: center;

    border: solid 0.1rem #36384B;

    opacity: 0.5;
}

span:last-of-type:hover {
    border: solid 0.1rem;
    border-image: linear-gradient(90deg, rgba(128, 125, 225, 1), rgba(33, 140, 222, 1)) 1 1;

    opacity: 1;
}

.img-container {
    position: relative;
}

.arrow {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: v-bind(transformValue);

    width: 13rem;
    height: 13rem;

    text-align: center;
}

.arrow>img {
    position: absolute;
    left: 50%;
    top: 0;
    transform: translateX(-50%);
}
</style>